import { createApp } from 'vue'
import App from './App.vue'
// import * as Echarts from "echarts";
import 'normalize.css'
import './assets/css/common.css'
import router from './router'
import ECharts from 'vue-echarts'
import { use } from "echarts/core"


// import ECharts modules manually to reduce bundle size
import {
  CanvasRenderer
} from 'echarts/renderers'
import {
  BarChart,
  LineChart,
  PieChart,
  MapChart,
  ScatterChart,
  EffectScatterChart,
  CustomChart
} from 'echarts/charts'
import { UniversalTransition } from 'echarts/features';
import {
  GridComponent,
  TooltipComponent,
  TitleComponent,
  LegendComponent,
  GeoComponent
} from 'echarts/components'

use([
  CanvasRenderer,
  BarChart,
  LineChart,
  PieChart,
  MapChart,
  GeoComponent,
  ScatterChart,
  EffectScatterChart,
  CustomChart,
  GridComponent,
  UniversalTransition,
  LegendComponent,
  TooltipComponent,
  TitleComponent
])


const app = createApp(App)
// 将echarts挂载到全局上
// app.config.globalProperties.$echarts = Echarts;


app.use(router);
//  全局注册vue-echarts
app.component('v-chart', ECharts)

app.mount('#app')